package com.wondream.myframework.design_pattern.strategy;

import lombok.AllArgsConstructor;
import lombok.Data;

@AllArgsConstructor
@Data
public class Compressor {

    private ICompressStrategy strategy;

    public void compress(){
        System.out.println("[[Compressor.compress]] start");
        strategy.compress();
        System.out.println("[[Compressor.compress]] end");
    }

    public static void main(String[] args) {
        new Compressor(new GzipCompressor()).compress();
        new Compressor(new ZipCompressor()).compress();
    }
}
